package ch.rheintalconnection.sysventory.presentation;

import java.util.ArrayList;
import java.util.List;

import ch.rheintalconnection.sysventory.businessServices.DataService;
import ch.rheintalconnection.sysventory.businessServices.NetworkScanner;
import ch.rheintalconnection.sysventory.businessServices.ScanningService;
import ch.rheintalconnection.sysventory.technicalServices.IDataReader;
import ch.rheintalconnection.sysventory.technicalServices.IDataWriter;
import ch.rheintalconnection.sysventory.technicalServices.IHostScanner;
import ch.rheintalconnection.sysventory.technicalServices.IIpScanner;
import ch.rheintalconnection.sysventory.technicalServices.IpScanner;
import ch.rheintalconnection.sysventory.technicalServices.hibernate.MySqlDataReader;
import ch.rheintalconnection.sysventory.technicalServices.hibernate.MySqlDataWriter;
import ch.rheintalconnection.sysventory.technicalServices.wmi.WMIHostScanner;

/**
 * @author Jonas Benz
 */
public class Bootstrapper {
	
	private ScanningService scanningService;
	private IDataReader dataReader;
	private IDataWriter dataWriter;
	private DataService dataService;
	
	public Bootstrapper() {
		
		List<IHostScanner> hostScanners = new ArrayList<IHostScanner>();
		hostScanners.add(new WMIHostScanner("localhost"));
		
		IIpScanner ipScanner = new IpScanner();
		
		dataReader = new MySqlDataReader();
		
		NetworkScanner networkScanner = new NetworkScanner(ipScanner, dataReader);
		
		dataWriter = new MySqlDataWriter();

		scanningService = new ScanningService(networkScanner, dataWriter);
		dataService = new DataService(dataReader);
	}

	public ScanningService getScanningService() {
		return scanningService;
	}
	
	public IDataReader getDataReader() {
		return dataReader;
	}

	public DataService getDataService(){
		return dataService;
	}
}
